<#-- @ftlvariable name="entity" type="com.xci.platform.auth.entity.UserEntity" -->
<#-- @ftlvariable name="selfDataMessage" type="java.lang.String" -->
<#-- @ftlvariable name="dataMessage" type="java.lang.String" -->
<#include "/_inc/_layout.ftl">
<#include "/auth/history/_history.ftl">
<#include "/auth/urmap/user-details.ftl">
<#include "/auth/objectmap/module-details.ftl">
<#include "/auth/objectmap/data-details.ftl">
<@header/>
<div class="jxpanel jx-overflow-no winpanel" data-options="fit:true">
    <div class="jxtabs jxtabs-line" data-options="{fit:true}">
        <ul class="nav nav-tabs">
            <li class="active"><a href="#tab-basic" data-toggle="tab">基本信息</a></li>
            <li><a href="#tab-role" data-toggle="tab">拥有角色</a></li>
            <li><a href="#tab-module" data-toggle="tab">功能权限</a></li>
            <li><a href="#tab-data" data-toggle="tab">数据权限</a></li>
            <li><a href="#tab-history" data-toggle="tab">操作日志</a></li>
        </ul>
        <div class="tab-content">
            <div id="tab-basic" class="tab-pane jx-overflow-auto fade in active">
                <table class="table table-bordered jxtable-details">
                    <tr>
                        <th class="w-120px">账号</th>
                        <td>${entity.account!?html}</td>
                        <th class="w-120px">姓名</th>
                        <td>${entity.name!?html}</td>
                    </tr>
                    <tr>
                        <th>组织机构</th>
                        <td>
                            <a href="#"
                               onclick="jx.auth.showDepartmentDetails('${entity.departmentId}');">${entity.departmentName!?html}</a>
                        </td>
                        <th>登录次数</th>
                        <td>${entity.loginCount!?html}</td>
                    </tr>
                    <tr>
                        <th>手机</th>
                        <td>${entity.mobile!?html}</td>
                        <th>邮件</th>
                        <td>${entity.email!?html}</td>
                    </tr>
                    <tr>
                        <th>首次登录时间</th>
                        <td>${helper.formatDateTime(entity.firstVisit)!}</td>
                        <th>最后登录时间</th>
                        <td>${helper.formatDateTime(entity.lastVisit)!}</td>
                    </tr>
                    <tr>
                        <th>管理员</th>
                        <td><@html.yesnoLabel value=entity.isAdmin/></td>
                        <th>状态</th>
                        <td><@html.boolLabel value=entity.status /></td>
                    </tr>
                    <tr>
                        <th>操作人</th>
                        <td>${entity.operateUserName!?html}</td>
                        <th>操作时间</th>
                        <td>${helper.formatDateTime(entity.operateDateTime)!}</td>
                    </tr>
                    <tr>
                        <th>数据权限</th>
                        <td colspan="3">
                        ${selfDataMessage!?html}
                        </td>
                    </tr>
                    <tr>
                        <th>备注</th>
                        <td colspan="3">${entity.remark!?html}</td>
                    </tr>
                </table>
            </div>
            <div id="tab-role" class="tab-pane jx-overflow-auto fade">
                <@userDetails userId=entity.id/>
            </div>
            <div id="tab-module" class="tab-pane jx-overflow-auto fade">
                <@moduleDetails objectName="User" objectId=entity.id/>
            </div>
            <div id="tab-data" class="tab-pane jx-overflow-auto fade">
                <@dataDetails message=dataMessage/>
            </div>
            <div id="tab-history" class="tab-pane jx-overflow-auto fade">
                <@histroy tableName="sys_user" keyValue=entity.id/>
            </div>
        </div>
    </div>
</div>
<@footer>
    <script>
        jx.auth.tabsAuthInit();
    </script>
</@footer>